<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>/weixin/applet/login/loginByOpenid.json</title>
	<link rel="stylesheet" href="http://res.zvo.cn.obs.cn-north-4.myhuaweicloud.com/javadoc/template/style.css" />
</head>
<body>
<div class="ctm">
	<div class="tils">接口URL</div>
	<div  class="txast" id="api.url">/weixin/applet/login/loginByOpenid.json</div>

	<div class="tils">说明</div>
	<div class="txast" id="api.commentText">通过 code(openid) 自动登陆 。
 <p>用到微信小程序的 wx.login 进行获取code</p>
 <p>1. 微信获取随机code，传入此处； </p>
 <p>2. 服务器通过code拉取用户 unionid；  </p>
 <p>3. 利用 unionid 来判断用户是否存在及设置用户自动登陆状态</p></div>

	<div class="tils">作者</div>
	<div class="txast" id="api.author">管雷鸣</div>

	<div class="tils">请求方式</div>
	<div class="txast" id="api.method">POST</div>

	<div class="tils">传入参数</div>
	<div class="txast chuancan" id="api.params"></div>

	<div class="tils">返回值显示</div>
	<div class="txast chuancan" id="qweq"></div>

</div>

<script>
var requestParam = {"code":{"commentText":"微信小程序获取的随机code","defaultValue":"","name":"code","required":false,"type":"String"}};	//传入参数
var responseReturn = {"list":[{"commentText":"user.id 跟 微信小程序 openid 的关联表","name":"WeixinAppletUserOpenid","sub":{"list":[{"commentText":"自增id","name":"id","sub":null,"type":"整数"},{"commentText":"用户的id,关联user.id","name":"userid","sub":null,"type":"整数"},{"commentText":"微信小程序用code兑换得openid","name":"openid","sub":null,"type":"字符串"}]},"type":"JSON对象"},{"commentText":"当前登录的用户的信息","name":"user","sub":null,"type":"com.xnx3.j2ee.entity.User"},{"commentText":"小程序使用code登录之后，会返回一个 sessionKey","name":"sessionKey","sub":null,"type":"字符串"},{"commentText":"本系统用户登录会话的sessionid","name":"token","sub":null,"type":"字符串"}]};	//响应结果
</script>
<script src="http://res.zvo.cn.obs.cn-north-4.myhuaweicloud.com/javadoc/template/htmldoc.js"></script>


<!-- 在线测试请求 -->
<script src="http://res.zvo.cn/wm/wm.js"></script>
<script src="http://res.zvo.cn.obs.cn-north-4.myhuaweicloud.com/javadoc/template/demorequest.js"></script>
<style>
	button{
		border: none;
		background-color: #fff;
		cursor: pointer;
	}
	.xtil{
		text-align: center;
		display: flex;
		height: 30px;
		font-size: 15px;
		line-height: 15px;
		justify-content: center;
		align-content: center;
		align-items: center;
		cursor: pointer;
		position: absolute;
		left: -10%;
		top: 0;
		width: 120%;
		z-index: 10000;
		background-color: #002376;
		color: #fff;
	}
	#demo{
		position: fixed;
		right: 30px;
/*		left: calc(50% + 300px);*/
		right: calc(50% - 500px);
/*		top: 85px;*/
		top: 25px;
		box-sizing: border-box;
		border-radius: 8px;
		box-shadow: 1px 0px 9px 0px #dbdbdb;
		z-index: 100;
		background-color: #fff;
		overflow: hidden;
		width: 120px;
		height: 30px;
		padding: 0;
		transition: all 0.3s;
	}
	#demo:hover{
		padding: 0 20px 20px;
		height: 30px;
/*		overflow: auto;*/
		height: 800px;
		width: 380px;
	}
	#demo:hover .xtil{
		display: none;
	}
	.btbox{
		padding: 10px 0;
/*		text-align: center;*/
	}
	
	.btntj{
		padding: 10px 30px;
		background-color: #283593;
		color: #fff;
		font-size: 15px;
		line-height: 15px;
		border-radius: 6px;
	}
	.sztinp{
		display: flex;
		align-content: center;
		align-items: center;
		margin: 10px 0 0 0;
		background-color: #f2f2f2;
		border-radius: 4px;
		overflow: hidden;
	}
	.btnsz,.btnym{
		display: flex;
		width: 60px;
		height: 28px;
		justify-content: center;
		align-content: center;
		align-items: center;
		background-color: #03a9f4;
		font-size: 14px;
		line-height: 14px;
		color: #fff;
	}
	.sztil{
		font-size: 18px;
		color: #000;
		font-weight: 600;
		margin-top: 16px;
	}
	
	.szbox input{
		flex: 1;
		display: flex;
		border: 0;
		margin: 0;
		padding: 6px;
		background-color: #f2f2f2;
		border-bottom: 1px dashed #ddd;
		color: #aaa;
		transition: all 0.2s;
		box-sizing: border-box;
		height: 28px;
		font-size: 14px;
		line-height: 14px;
	}
	#demoForm .szbox input{
		margin-top: 4px;
	}
	input:focus-visible {
		outline: none;
		border-bottom: 1px solid #ddd;
		color: #000;
	}
	.csli{
		display: flex;
		flex-wrap: wrap;
	}
	.csli .csbox{
		width: 100%;
		margin-top: 10px;
		font-size: 14px;
		color: #333;
	}
	pre#demoResponseResult{
		width: 100%;
		max-height: 410px;
		white-space: normal;
		overflow-y: auto;
		background-color: #f2f2f2;
		padding: 6px;
		border-radius: 6px;
		font-size: 14px;
		font-weight: 500;
		-webkit-user-modify: read-write-plaintext-only;
	}
</style>
</body>
</html>
